import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 30318
 * Date: 2023-10-17
 * Time: 17:28
 */
public class SumAllNumbers {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter a number between 0 and 1000: ");
        int number = scanner.nextInt();
        int sum = 0;
        int tmp = number;
        while (tmp > 0)
        {
            sum += tmp % 10;
            tmp /= 10;
        }
        System.out.println("The sum of the digits is " + sum);
    }
}
